<?php
/**
 * Copyright (c) Sandeep Manne (sandeep.manne@gmail.com) 
 *
 * @author  Sandeep Manne
 * @since   Nov 1, 2008, 3:46:48 PM
 * @version $Id: application.php 2 2008-12-30 07:03:54Z ramses $
 */

/**
 * Append environment settings
 */
require_once 'environment/Constants.php';
require_once 'environment/Settings.php';

/**
 * Application Startup
 */
require_once 'startup/application.php';
require_once 'startup/cache.php';
require_once 'startup/layout.php';
require_once 'startup/database.php';
require_once 'startup/frontController.php';
require_once 'startup/routes.php';

/**
 * Dispatch application
 */
if (DEBUG) {
    try {
        $frontController->dispatch();
    } catch (Exception $e) {
        Zend_Debug::dump($e);
    }
} else {
    $frontController->dispatch();
}

/**
 * Cleanup global variables
 */
unset($settings, $dbConfig, $dbAdapter, $frontController, $router, $cache, $cacheFile);
